package com.flymobi.wap;

import com.flymobi.fw.util.ImageUtil;
import com.flymobi.fw.util.PasswordUtil;
import com.flymobi.util.C;
import com.flymobi.util.WebContext;
import com.flymobi.util.WebUtil;

/**
 * 
 * 
 * Title:
 * 
 * Description:
 * 
 * Copyright: Copyright (c) 2008
 * 
 * @author haoxz11
 * @created Oct 27, 2008 2:03:14 PM
 * @version $Id: ValidateCodeAction.java,v 1.1 2010/04/09 03:27:15 airsou Exp $
 */
public class ValidateCodeAction extends WapAction {

	/**
	 * Comment for <code>serialVersionUID</code>
	 */
	private static final long serialVersionUID = 1L;

	/* (non-Javadoc)
	 * @see com.flymobi.wap.WapAction#getActionid()
	 */
	@Override
	public long getActionid() {
		return C.Action.checkcode;
	}

	/* (non-Javadoc)
	 * @see com.flymobi.wap.WapAction#webProcess(com.flymobi.util.WebContext)
	 */
	@Override
	public String webProcess(WebContext context) {
		String code=PasswordUtil.genRandomNum(4).toUpperCase();
		//userState.setCheckCode(code);
		WebUtil.printImageStream(context,ImageUtil.TwistImage(ImageUtil.getValidateImage(code), true, 3, 4));
		return null;
	}

}
